Auto refactor code